package de.mhus.lib.mandala.text;

import de.mhus.lib.mandala.Response;
import de.mhus.lib.mandala.attributes.ArrayAttribute;

public class DropdownField extends Field {

	private String optionsValue = "id";
	private String optionsText = "name";
		
	@Override
	protected void doRender(Response response) {
		//<select data-bind="
		//  options: prefixList, 
		//  optionsValue: 'id', 
		//  optionsText: 'name', 
		//  value: f_prefix, 
		//  visible: isEditDetails"></select>
		
		response.singleTag("select", "form-control", getTagAttributes(),
				"disabled", isEnabled() ? null : "disabled",
				"data-bind","optionsValue: " + optionsValue + ", optionsText: " + optionsText );
	}

	public String getOptionsValue() {
		return optionsValue;
	}

	public void setOptionsValue(String optionsValue) {
		this.optionsValue = optionsValue;
	}

	public String getOptionsText() {
		return optionsText;
	}

	public void setOptionsText(String optionsText) {
		this.optionsText = optionsText;
	}
	
}
